package com.config.controller;

import com.config.dao.UserMapper;
import com.config.entity.User;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by chenjie on 2017/5/9.
 */
@RefreshScope
@RestController
public class userController {
    public final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private UserMapper userMapper;

    @Value("${foo}")
    String foo;
    @RequestMapping(value = "/hi")
    public String hi(){
        List<User> aaa = userMapper.findByName("AAA");
//        System.out.println(u.getName());
        return foo;
    }
}
